#if !defined(AFX_IMG_WND_H__0FE7D63C_2641_4769_A4C3_4318DC9A5CA8__INCLUDED_)
#define AFX_IMG_WND_H__0FE7D63C_2641_4769_A4C3_4318DC9A5CA8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Img_Wnd.h : header file
//
#include "memdc.h"
#include "rect_tracker.h"
/////////////////////////////////////////////////////////////////////////////
// CImg_Wnd view

class CImg_Pro;
class CImg_Wnd : public CView
{
public:
	friend class CImg_Pro;
	

// Construction
public:
	CImg_Wnd();           // protected constructor used by dynamic creation
	virtual ~CImg_Wnd();
	DECLARE_DYNCREATE(CImg_Wnd)

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

public:
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CImg_Wnd)
	public:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void PostNcDestroy();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();     // first time after construct
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	virtual void OnActivateFrame(UINT nState, CFrameWnd* pFrameWnd);
	int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);

public:
	CRect get_imgrect_selection();
	void move_view(CRect &rt);
	void init_tracker_rect(CRect* rt_ = NULL);      
	bool SetImageRectSelection(CRect *rect = NULL,bool copy_img = true);
	//}}AFX_VIRTUAL

	// Generated message map functions
protected:
	//{{AFX_MSG(CImg_Wnd)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	void __copy_image();
	CxImage* __get_img();
	void __draw_dot_line(CDC * pDC);
	void __get_img_xy(long *x, long *y);
	CImg_Pro* __get_img_pro(){return m_pImg_Pro;}

private:
	CImg_Pro* m_pImg_Pro;
	rect_tracker m_tracker;
	UINT_PTR	m_img_select_timer;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_IMG_WND_H__0FE7D63C_2641_4769_A4C3_4318DC9A5CA8__INCLUDED_)
